//
//  UIBarButton+Extension.swift
//  SinaWeiBoProject
//
//  Created by 房城鸿 on 15/10/16.
//  Copyright © 2015年 房兰峰. All rights reserved.
//

import UIKit

extension UIBarButtonItem{
    
    convenience init(imageName:String,target: AnyObject?, actionName: String?){
        
        let button = UIButton(imageName: imageName)
        // 添加监听方法
        if target != nil && actionName != nil{
            
            button.addTarget(target, action: Selector(actionName!), forControlEvents: UIControlEvents.TouchUpInside)
        }
        self.init(customView: button)
    }
}
